<?php

/**
 * Created by PhpStorm.
 * User: xuke
 * Date: 16/6/12
 * Time: 下午2:11
 */
namespace App\Http\Controllers\Api\System;
use App\Http\Controllers\BaseController;
use App\Logic\AccessToken AS AccessTokenLogic;
use ApiResultFacade;

class TokenController extends BaseController
{
    /**
     * 
     */
    public function createToken()
    {
        $device_info = $this->_request->input('device');
        if (!is_array($device_info))
        {
            $device_info = json_decode($device_info, true);
        }
        $accessToken = AccessTokenLogic::create($device_info)->toApi();
        return ApiResultFacade::setData($accessToken)->ApiResult();
    }
}